fix(kimaki): make dm-context-filter strip-only#119
Merged
Conversation
The plugin was appending two Data Machine-specific sections ("## WordPress
Site Runtime" and "## Data Machine Session Handoff") to every system
prompt. That is bridge-specific positive guidance and recreates the same
problem the filter exists to solve: runtime-bridge concerns leaking into
the generic agent context.
Positive guidance about how to use the Kimaki bridge or the WordPress
site runtime belongs in Data Machine's instruction stack (AGENTS.md,
SOUL.md, SITE.md, etc.), not pre-injected by the runtime filter.
Changes:
- Remove appendWordPressSiteRuntimeInstruction() and call site.
- Remove appendDataMachineSessionHandoffInstruction() and call site.
- Update file header docstring to reflect strip-only contract.
- Drop "## Data Machine Session Handoff" from
DEFAULT_ALLOW_LEAK_SECTIONS in tests/effective-prompt/run.mjs since
the filter no longer appends it (no leak exemption needed).
- Refresh effective-prompt snapshots.
Test: tests/effective-prompt passes both scenarios with 0 filtered
leaks (down from 11 baseline leaks). Filter now strips ~6,070 tokens
per session, ~1,058 more than the broken baseline.
AI assistance: Yes
Tool(s): Claude Code (claude-opus-4-7)
Used for: drafted the change after Chris identified the architectural
boundary (plugin = strip-only; positive guidance lives in instruction
files). Human reviewed every edit and ran the test suite.
Open
3 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
The dm-context-filter plugin was appending two Data Machine-specific sections to every system prompt:
## WordPress Site Runtime## Data Machine Session HandoffThat is bridge-specific positive guidance, and pre-injecting it via the runtime filter recreates the exact problem the filter exists to solve: runtime-bridge concerns leaking into the generic agent context.
This PR makes the plugin strip-only. Positive guidance about how to use the Kimaki bridge or the WordPress site runtime belongs in Data Machine's instruction stack (AGENTS.md, SOUL.md, SITE.md), not pre-injected by the bridge filter.
Why
The whole point of dm-context-filter is to keep bridge-specific guidance out of the agent's prompt — Kimaki worktree/cross-project sections, scheduling, dev-server, critique, etc. Adding our own bridge-specific appendix on the way out contradicted that. AGENTS.md (generated by Data Machine Code) and the rest of the instruction stack are the right home for any guidance the agent needs about how to use the bridge — they're discoverable, editable, and live with other agent guidance.
Changes
bridges/kimaki/plugins/dm-context-filter.ts: RemoveappendWordPressSiteRuntimeInstruction()andappendDataMachineSessionHandoffInstruction()functions and their call sites. Update file header docstring to document the strip-only contract.tests/effective-prompt/run.mjs: Drop"## Data Machine Session Handoff"fromDEFAULT_ALLOW_LEAK_SECTIONS. The filter no longer appends that section, so no leak exemption is needed. Any trigger word in filtered output is now a real leak.tests/effective-prompt/__snapshots__/: Refreshdefault.filtered.txtandno-agents-no-thread.filtered.txt.Net effect
Test
AI assistance